AmCharts.AmSerialChart=AmCharts.Class({inherits:AmCharts.AmRectangularChart,construct:function(t){this.type="serial";AmCharts.AmSerialChart.base.construct.call(this,t);this.cname="AmSerialChart";this.theme=t;this.createEvents("changed");this.columnSpacing=5;this.columnSpacing3D=0;this.columnWidth=.8;this.updateScrollbar=!0;var i=new AmCharts.CategoryAxis(t);i.chart=this;this.categoryAxis=i;this.zoomOutOnDataUpdate=!0;this.mouseWheelZoomEnabled=this.mouseWheelScrollEnabled=this.rotate=this.skipZoom=!1;this.minSelectedTime=0;AmCharts.applyTheme(this,t,this.cname)},initChart:function(){AmCharts.AmSerialChart.base.initChart.call(this);this.updateCategoryAxis(this.categoryAxis,this.rotate,"categoryAxis");this.dataChanged&&(this.updateData(),this.dataChanged=!1,this.dispatchDataUpdated=!0);var t=this.chartCursor;t&&(t.updateData(),t.fullWidth&&(t.fullRectSet=this.cursorLineSet));var t=this.countColumns(),i=this.graphs,e;for(e=0;e<i.length;e++)i[e].columnCount=t;this.updateScrollbar=!0;this.drawChart();this.autoMargins&&!this.marginsUpdated&&(this.marginsUpdated=!0,this.measureMargins());(this.mouseWheelScrollEnabled||this.mouseWheelZoomEnabled)&&this.addMouseWheel()},handleWheelReal:function(t,i){if(!this.wheelBusy){var e=this.categoryAxis,s=e.parseDates,a=e.minDuration(),h=e=1;this.mouseWheelZoomEnabled?i||(e=-1):i&&(e=-1);var r=this.chartData.length,o=this.lastTime,n=this.firstTime;0>t?s?(r=this.endTime-this.startTime,s=this.startTime+e*a,a=this.endTime+h*a,0<h&&0<e&&a>=o&&(a=o,s=o-r),this.zoomToDates(new Date(s),new Date(a))):(0<h&&0<e&&this.end>=r-1&&(e=h=0),s=this.start+e,a=this.end+h,this.zoomToIndexes(s,a)):s?(r=this.endTime-this.startTime,s=this.startTime-e*a,a=this.endTime-h*a,0<h&&0<e&&s<=n&&(s=n,a=n+r),this.zoomToDates(new Date(s),new Date(a))):(0<h&&0<e&&1>this.start&&(e=h=0),s=this.start-e,a=this.end-h,this.zoomToIndexes(s,a))}},validateData:function(t){this.marginsUpdated=!1;this.zoomOutOnDataUpdate&&!t&&(this.endTime=this.end=this.startTime=this.start=NaN);AmCharts.AmSerialChart.base.validateData.call(this)},drawChart:function(){AmCharts.AmSerialChart.base.drawChart.call(this);var t=this.chartData;if(AmCharts.ifArray(t)){var i=this.chartScrollbar;i&&i.draw();if(0<this.realWidth&&0<this.realHeight){var t=t.length-1,e,i=this.categoryAxis;if(i.parseDates&&!i.equalSpacing){if(i=this.startTime,e=this.endTime,isNaN(i)||isNaN(e))i=this.firstTime,e=this.lastTime}else if(i=this.start,e=this.end,isNaN(i)||isNaN(e))i=0,e=t;this.endTime=this.startTime=this.end=this.start=void 0;this.zoom(i,e)}}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},cleanChart:function(){AmCharts.callMethod("destroy",[this.valueAxes,this.graphs,this.categoryAxis,this.chartScrollbar,this.chartCursor])},updateCategoryAxis:function(t,i,e){t.chart=this;t.id=e;t.rotate=i;t.axisRenderer=AmCharts.RecAxis;t.guideFillRenderer=AmCharts.RecFill;t.axisItemRenderer=AmCharts.RecItem;t.setOrientation(!this.rotate);t.x=this.marginLeftReal;t.y=this.marginTopReal;t.dx=this.dx;t.dy=this.dy;t.width=this.plotAreaWidth-1;t.height=this.plotAreaHeight-1;t.viW=this.plotAreaWidth-1;t.viH=this.plotAreaHeight-1;t.viX=this.marginLeftReal;t.viY=this.marginTopReal;t.marginsChanged=!0},updateValueAxes:function(){AmCharts.AmSerialChart.base.updateValueAxes.call(this);var t=this.valueAxes,i;for(i=0;i<t.length;i++){var e=t[i],s=this.rotate;e.rotate=s;e.setOrientation(s);s=this.categoryAxis;if(!s.startOnAxis||s.parseDates)e.expandMinMax=!0}},updateData:function(){this.parseData();var t=this.graphs,i,e=this.chartData;for(i=0;i<t.length;i++)t[i].data=e;0<e.length&&(this.firstTime=this.getStartTime(e[0].time),this.lastTime=this.getEndTime(e[e.length-1].time))},getStartTime:function(t){var i=this.categoryAxis;return AmCharts.resetDateToMin(new Date(t),i.minPeriod,1,i.firstDayOfWeek).getTime()},getEndTime:function(t){var i=AmCharts.extractPeriod(this.categoryAxis.minPeriod);return AmCharts.changeDate(new Date(t),i.period,i.count,!0).getTime()-1},updateMargins:function(){AmCharts.AmSerialChart.base.updateMargins.call(this);var t=this.chartScrollbar;t&&(this.getScrollbarPosition(t,this.rotate,this.categoryAxis.position),this.adjustMargins(t,this.rotate))},updateScrollbars:function(){AmCharts.AmSerialChart.base.updateScrollbars.call(this);this.updateChartScrollbar(this.chartScrollbar,this.rotate)},zoom:function(t,i){var e=this.categoryAxis;e.parseDates&&!e.equalSpacing?this.timeZoom(t,i):this.indexZoom(t,i);this.updateLegendValues()},timeZoom:function(t,i){var e=this.maxSelectedTime;isNaN(e)||(i!=this.endTime&&i-t>e&&(t=i-e,this.updateScrollbar=!0),t!=this.startTime&&i-t>e&&(i=t+e,this.updateScrollbar=!0));var s=this.minSelectedTime;if(0<s&&i-t<s){var a=Math.round(t+(i-t)/2),s=Math.round(s/2);t=a-s;i=a+s}var h=this.chartData,a=this.categoryAxis;if(AmCharts.ifArray(h)&&(t!=this.startTime||i!=this.endTime)){var r=a.minDuration(),s=this.firstTime,o=this.lastTime;t||(t=s,isNaN(e)||(t=o-e));i||(i=o);t>o&&(t=o);i<s&&(i=s);t<s&&(t=s);i>o&&(i=o);i<t&&(i=t+r);i-t<r/5&&(i<o?i=t+r/5:t=i-r/5);this.startTime=t;this.endTime=i;e=h.length-1;r=this.getClosestIndex(h,"time",t,!0,0,e);h=this.getClosestIndex(h,"time",i,!1,r,e);a.timeZoom(t,i);a.zoom(r,h);this.start=AmCharts.fitToBounds(r,0,e);this.end=AmCharts.fitToBounds(h,0,e);this.zoomAxesAndGraphs();this.zoomScrollbar();t!=s||i!=o?this.showZB(!0):this.showZB(!1);this.updateColumnsDepth();this.dispatchTimeZoomEvent()}},indexZoom:function(t,i){var e=this.maxSelectedSeries;isNaN(e)||(i!=this.end&&i-t>e&&(t=i-e,this.updateScrollbar=!0),t!=this.start&&i-t>e&&(i=t+e,this.updateScrollbar=!0));if(t!=this.start||i!=this.end){var s=this.chartData.length-1;isNaN(t)&&(t=0,isNaN(e)||(t=s-e));isNaN(i)&&(i=s);i<t&&(i=t);i>s&&(i=s);t>s&&(t=s-1);0>t&&(t=0);this.start=t;this.end=i;this.categoryAxis.zoom(t,i);this.zoomAxesAndGraphs();this.zoomScrollbar();0!==t||i!=this.chartData.length-1?this.showZB(!0):this.showZB(!1);this.updateColumnsDepth();this.dispatchIndexZoomEvent()}},updateGraphs:function(){AmCharts.AmSerialChart.base.updateGraphs.call(this);var t=this.graphs,i;for(i=0;i<t.length;i++){var e=t[i];e.columnWidthReal=this.columnWidth;e.categoryAxis=this.categoryAxis;AmCharts.isString(e.fillToGraph)&&(e.fillToGraph=this.getGraphById(e.fillToGraph))}},updateColumnsDepth:function(){var t,i=this.graphs,e;AmCharts.remove(this.columnsSet);this.columnsArray=[];for(t=0;t<i.length;t++){e=i[t];var s=e.columnsArray;if(s){var a;for(a=0;a<s.length;a++)this.columnsArray.push(s[a])}}this.columnsArray.sort(this.compareDepth);if(0<this.columnsArray.length){i=this.container.set();this.columnSet.push(i);for(t=0;t<this.columnsArray.length;t++)i.push(this.columnsArray[t].column.set);e&&i.translate(e.x,e.y);this.columnsSet=i}},compareDepth:function(t,i){return t.depth>i.depth?1:-1},zoomScrollbar:function(){var t=this.chartScrollbar,i=this.categoryAxis;t&&this.updateScrollbar&&(i.parseDates&&!i.equalSpacing?t.timeZoom(this.startTime,this.endTime):t.zoom(this.start,this.end),this.updateScrollbar=!0)},updateTrendLines:function(){var t=this.trendLines,i;for(i=0;i<t.length;i++){var e=t[i],e=AmCharts.processObject(e,AmCharts.TrendLine,this.theme);t[i]=e;e.chart=this;AmCharts.isString(e.valueAxis)&&(e.valueAxis=this.getValueAxisById(e.valueAxis));e.valueAxis||(e.valueAxis=this.valueAxes[0]);e.categoryAxis=this.categoryAxis}},zoomAxesAndGraphs:function(){if(!this.scrollbarOnly){var t=this.valueAxes,i;for(i=0;i<t.length;i++)t[i].zoom(this.start,this.end);t=this.graphs;for(i=0;i<t.length;i++)t[i].zoom(this.start,this.end);this.zoomTrendLines();(i=this.chartCursor)&&i.zoom(this.start,this.end,this.startTime,this.endTime)}},countColumns:function(){var t=0,i=this.valueAxes.length,e=this.graphs.length,s,a,h=!1,r,o;for(o=0;o<i;o++){a=this.valueAxes[o];var n=a.stackType;if("100%"==n||"regular"==n)for(h=!1,r=0;r<e;r++)s=this.graphs[r],s.tcc=1,s.valueAxis==a&&"column"==s.type&&(!h&&s.stackable&&(t++,h=!0),(!s.stackable&&s.clustered||s.newStack)&&t++,s.columnIndex=t-1,s.clustered||(s.columnIndex=0));if("none"==n||"3d"==n){h=!1;for(r=0;r<e;r++)s=this.graphs[r],s.valueAxis==a&&"column"==s.type&&(s.clustered?(s.tcc=1,s.newStack&&(t=0),s.hidden||(s.columnIndex=t,t++)):s.hidden||(h=!0,s.tcc=1,s.columnIndex=0));h&&0==t&&(t=1)}if("3d"==n){a=1;for(o=0;o<e;o++)s=this.graphs[o],s.newStack&&a++,s.depthCount=a,s.tcc=t;t=a}}return t},parseData:function(){AmCharts.AmSerialChart.base.parseData.call(this);this.parseSerialData()},getCategoryIndexByValue:function(t){var i=this.chartData,e,s;for(s=0;s<i.length;s++)i[s].category==t&&(e=s);return e},handleCursorChange:function(t){this.updateLegendValues(t.index)},handleCursorZoom:function(t){this.updateScrollbar=!0;this.zoom(t.start,t.end)},handleScrollbarZoom:function(t){this.updateScrollbar=!1;this.zoom(t.start,t.end)},dispatchTimeZoomEvent:function(){if(this.prevStartTime!=this.startTime||this.prevEndTime!=this.endTime){var t={type:"zoomed"};t.startDate=new Date(this.startTime);t.endDate=new Date(this.endTime);t.startIndex=this.start;t.endIndex=this.end;this.startIndex=this.start;this.endIndex=this.end;this.startDate=t.startDate;this.endDate=t.endDate;this.prevStartTime=this.startTime;this.prevEndTime=this.endTime;var i=this.categoryAxis,e=AmCharts.extractPeriod(i.minPeriod).period,i=i.dateFormatsObject[e];t.startValue=AmCharts.formatDate(t.startDate,i,this);t.endValue=AmCharts.formatDate(t.endDate,i,this);t.chart=this;t.target=this;this.fire(t.type,t)}},dispatchIndexZoomEvent:function(){if(this.prevStartIndex!=this.start||this.prevEndIndex!=this.end){this.startIndex=this.start;this.endIndex=this.end;var t=this.chartData;if(AmCharts.ifArray(t)&&!isNaN(this.start)&&!isNaN(this.end)){var i={chart:this,target:this,type:"zoomed"};i.startIndex=this.start;i.endIndex=this.end;i.startValue=t[this.start].category;i.endValue=t[this.end].category;this.categoryAxis.parseDates&&(this.startTime=t[this.start].time,this.endTime=t[this.end].time,i.startDate=new Date(this.startTime),i.endDate=new Date(this.endTime));this.prevStartIndex=this.start;this.prevEndIndex=this.end;this.fire(i.type,i)}}},updateLegendValues:function(t){var i=this.graphs,e;for(e=0;e<i.length;e++){var s=i[e];isNaN(t)?s.currentDataItem=void 0:s.currentDataItem=this.chartData[t].axes[s.valueAxis.id].graphs[s.id]}this.legend&&this.legend.updateValues()},getClosestIndex:function(t,i,e,s,a,h){0>a&&(a=0);h>t.length-1&&(h=t.length-1);var r=a+Math.round((h-a)/2),o=t[r][i];if(1>=h-a){if(s)return a;s=t[h][i];return Math.abs(t[a][i]-e)<Math.abs(s-e)?a:h}return e==o?r:e<o?this.getClosestIndex(t,i,e,s,a,r):this.getClosestIndex(t,i,e,s,r,h)},zoomToIndexes:function(t,i){this.updateScrollbar=!0;var e=this.chartData;if(e){var s=e.length;0<s&&(0>t&&(t=0),i>s-1&&(i=s-1),s=this.categoryAxis,s.parseDates&&!s.equalSpacing?this.zoom(e[t].time,this.getEndTime(e[i].time)):this.zoom(t,i))}},zoomToDates:function(t,i){this.updateScrollbar=!0;var e=this.chartData;if(this.categoryAxis.equalSpacing){var s=this.getClosestIndex(e,"time",t.getTime(),!0,0,e.length);i=AmCharts.resetDateToMin(i,this.categoryAxis.minPeriod,1);e=this.getClosestIndex(e,"time",i.getTime(),!1,0,e.length);this.zoom(s,e)}else this.zoom(t.getTime(),i.getTime())},zoomToCategoryValues:function(t,i){this.updateScrollbar=!0;this.zoom(this.getCategoryIndexByValue(t),this.getCategoryIndexByValue(i))},formatPeriodString:function(t,i){if(i){var e=["value","open","low","high","close"],s="value open low high close average sum count".split(" "),a=i.valueAxis,h=this.chartData,r=i.numberFormatter;r||(r=this.nf);for(var o=0;o<e.length;o++){for(var n=e[o],d=0,l=0,m,c,u,g,p,f=0,A=0,C,D,x,v,T,b=this.start;b<=this.end;b++){var M=h[b];if(M&&(M=M.axes[a.id].graphs[i.id])){if(M.values){var y=M.values[n];if(!isNaN(y)){isNaN(m)&&(m=y);c=y;if(isNaN(u)||u>y)u=y;if(isNaN(g)||g<y)g=y;p=AmCharts.getDecimals(d);var S=AmCharts.getDecimals(y),d=d+y,d=AmCharts.roundTo(d,Math.max(p,S));l++;p=d/l}}if(M.percents&&(M=M.percents[n],!isNaN(M))){isNaN(C)&&(C=M);D=M;if(isNaN(x)||x>M)x=M;if(isNaN(v)||v<M)v=M;T=AmCharts.getDecimals(f);y=AmCharts.getDecimals(M);f+=M;f=AmCharts.roundTo(f,Math.max(T,y));A++;T=f/A}}}f={open:C,close:D,high:v,low:x,average:T,sum:f,count:A};t=AmCharts.formatValue(t,{open:m,close:c,high:g,low:u,average:p,sum:d,count:l},s,r,n+"\\.",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);t=AmCharts.formatValue(t,f,s,this.pf,"percents\\."+n+"\\.")}}return t=AmCharts.cleanFromEmpty(t)},formatString:function(t,i,e){var s=i.graph;if(-1!=t.indexOf("[[category]]")){var a=i.serialDataItem.category;if(this.categoryAxis.parseDates){var h=this.balloonDateFormat,r=this.chartCursor;r&&(h=r.categoryBalloonDateFormat);-1!=t.indexOf("[[category]]")&&(h=AmCharts.formatDate(a,h,this),-1!=h.indexOf("fff")&&(h=AmCharts.formatMilliseconds(h,a)),a=h)}t=t.replace(/\[\[category\]\]/g,String(a))}s=s.numberFormatter;s||(s=this.nf);a=i.graph.valueAxis;(h=a.duration)&&!isNaN(i.values.value)&&(a=AmCharts.formatDuration(i.values.value,h,"",a.durationUnits,a.maxInterval,s),t=t.replace(RegExp("\\[\\[value\\]\\]","g"),a));a="value open low high close total".split(" ");h=this.pf;t=AmCharts.formatValue(t,i.percents,a,h,"percents\\.");t=AmCharts.formatValue(t,i.values,a,s,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);t=AmCharts.formatValue(t,i.values,["percents"],h);-1!=t.indexOf("[[")&&(t=AmCharts.formatDataContextValue(t,i.dataContext));return t=AmCharts.AmSerialChart.base.formatString.call(this,t,i,e)},addChartScrollbar:function(t){AmCharts.callMethod("destroy",[this.chartScrollbar]);t&&(t.chart=this,this.listenTo(t,"zoomed",this.handleScrollbarZoom));this.rotate?void 0===t.width&&(t.width=t.scrollbarHeight):void 0===t.height&&(t.height=t.scrollbarHeight);this.chartScrollbar=t},removeChartScrollbar:function(){AmCharts.callMethod("destroy",[this.chartScrollbar]);this.chartScrollbar=null},handleReleaseOutside:function(t){AmCharts.AmSerialChart.base.handleReleaseOutside.call(this,t);AmCharts.callMethod("handleReleaseOutside",[this.chartScrollbar])}});AmCharts.Cuboid=AmCharts.Class({construct:function(t,i,e,s,a,h,r,o,n,d,l,m,c,u,g,p){this.set=t.set();this.container=t;this.h=Math.round(e);this.w=Math.round(i);this.dx=s;this.dy=a;this.colors=h;this.alpha=r;this.bwidth=o;this.bcolor=n;this.balpha=d;this.dashLength=u;this.topRadius=p;this.pattern=g;(this.rotate=c)?0>i&&0===l&&(l=180):0>e&&270==l&&(l=90);this.gradientRotation=l;0===s&&0===a&&(this.cornerRadius=m);this.draw()},draw:function(){var t=this.set;t.clear();var i=this.container,e=this.w,s=this.h,a=this.dx,h=this.dy,r=this.colors,o=this.alpha,n=this.bwidth,d=this.bcolor,l=this.balpha,m=this.gradientRotation,c=this.cornerRadius,u=this.dashLength,g=this.pattern,p=this.topRadius,f=r,A=r;"object"==typeof r&&(f=r[0],A=r[r.length-1]);var C,D,x,v,T,b,M,y,S,N=o;g&&(o=0);var w,I,W,P,R=this.rotate;if(0<Math.abs(a)||0<Math.abs(h))if(isNaN(p))M=A,A=AmCharts.adjustLuminosity(f,-.2),A=AmCharts.adjustLuminosity(f,-.2),C=AmCharts.polygon(i,[0,a,e+a,e,0],[0,h,h,0,0],A,o,1,d,0,m),0<l&&(S=AmCharts.line(i,[0,a,e+a],[0,h,h],d,l,n,u)),D=AmCharts.polygon(i,[0,0,e,e,0],[0,s,s,0,0],A,o,1,d,0,m),D.translate(a,h),0<l&&(x=AmCharts.line(i,[a,a],[h,h+s],d,l,n,u)),v=AmCharts.polygon(i,[0,0,a,a,0],[0,s,s+h,h,0],A,o,1,d,0,m),T=AmCharts.polygon(i,[e,e,e+a,e+a,e],[0,s,s+h,h,0],A,o,1,d,0,m),0<l&&(b=AmCharts.line(i,[e,e+a,e+a,e],[0,h,s+h,s],d,l,n,u)),A=AmCharts.adjustLuminosity(M,.2),M=AmCharts.polygon(i,[0,a,e+a,e,0],[s,s+h,s+h,s,s],A,o,1,d,0,m),0<l&&(y=AmCharts.line(i,[0,a,e+a],[s,s+h,s+h],d,l,n,u));else{var F,O,L;R?(F=s/2,A=a/2,L=s/2,O=e+a/2,I=Math.abs(s/2),w=Math.abs(a/2)):(A=e/2,F=h/2,O=e/2,L=s+h/2+1,w=Math.abs(e/2),I=Math.abs(h/2));W=w*p;P=I*p;.1<w&&.1<w&&(C=AmCharts.circle(i,w,f,o,n,d,l,!1,I),C.translate(A,F));.1<W&&.1<W&&(M=AmCharts.circle(i,W,AmCharts.adjustLuminosity(f,.5),o,n,d,l,!1,P),M.translate(O,L))}o=N;1>Math.abs(s)&&(s=0);1>Math.abs(e)&&(e=0);!isNaN(p)&&(0<Math.abs(a)||0<Math.abs(h))?(r=[f],r={fill:r,stroke:d,"stroke-width":n,"stroke-opacity":l,"fill-opacity":o},R?(o="M0,0 L"+e+","+(s/2-s/2*p),n=" B",0<e&&(n=" A"),AmCharts.VML?(o+=n+Math.round(e-W)+","+Math.round(s/2-P)+","+Math.round(e+W)+","+Math.round(s/2+P)+","+e+",0,"+e+","+s,o=o+(" L0,"+s)+(n+Math.round(-w)+","+Math.round(s/2-I)+","+Math.round(w)+","+Math.round(s/2+I)+",0,"+s+",0,0")):(o+="A"+W+","+P+",0,0,0,"+e+","+(s-s/2*(1-p))+"L0,"+s,o+="A"+w+","+I+",0,0,1,0,0"),w=90):(n=e/2-e/2*p,o="M0,0 L"+n+","+s,AmCharts.VML?(o="M0,0 L"+n+","+s,n=" B",0>s&&(n=" A"),o+=n+Math.round(e/2-W)+","+Math.round(s-P)+","+Math.round(e/2+W)+","+Math.round(s+P)+",0,"+s+","+e+","+s,o+=" L"+e+",0",o+=n+Math.round(e/2+w)+","+Math.round(I)+","+Math.round(e/2-w)+","+Math.round(-I)+","+e+",0,0,0"):(o+="A"+W+","+P+",0,0,0,"+(e-e/2*(1-p))+","+s+"L"+e+",0",o+="A"+w+","+I+",0,0,1,0,0"),w=180),i=i.path(o).attr(r),i.gradient("linearGradient",[f,AmCharts.adjustLuminosity(f,-.3),AmCharts.adjustLuminosity(f,-.3),f],w),R?i.translate(a/2,0):i.translate(0,h/2)):i=0===s?AmCharts.line(i,[0,e],[0,0],d,l,n,u):0===e?AmCharts.line(i,[0,0],[0,s],d,l,n,u):0<c?AmCharts.rect(i,e,s,r,o,n,d,l,c,m,u):AmCharts.polygon(i,[0,0,e,e,0],[0,s,s,0,0],r,o,n,d,l,m,!1,u);e=isNaN(p)?0>s?[C,S,D,x,v,T,b,M,y,i]:[M,y,D,x,v,T,C,S,b,i]:R?0<e?[C,i,M]:[M,i,C]:0>s?[C,i,M]:[M,i,C];for(s=0;s<e.length;s++)(a=e[s])&&t.push(a);g&&i.pattern(g)},width:function(t){this.w=Math.round(t);this.draw()},height:function(t){this.h=Math.round(t);this.draw()},animateHeight:function(t,i){var e=this;e.easing=i;e.totalFrames=Math.round(1e3*t/AmCharts.updateRate);e.rh=e.h;e.frame=0;e.height(1);setTimeout(function(){e.updateHeight.call(e)},AmCharts.updateRate)},updateHeight:function(){var t=this;t.frame++;var i=t.totalFrames;t.frame<=i&&(i=t.easing(0,t.frame,1,t.rh-1,i),t.height(i),setTimeout(function(){t.updateHeight.call(t)},AmCharts.updateRate))},animateWidth:function(t,i){var e=this;e.easing=i;e.totalFrames=Math.round(1e3*t/AmCharts.updateRate);e.rw=e.w;e.frame=0;e.width(1);setTimeout(function(){e.updateWidth.call(e)},AmCharts.updateRate)},updateWidth:function(){var t=this;t.frame++;var i=t.totalFrames;t.frame<=i&&(i=t.easing(0,t.frame,1,t.rw-1,i),t.width(i),setTimeout(function(){t.updateWidth.call(t)},AmCharts.updateRate))}});AmCharts.CategoryAxis=AmCharts.Class({inherits:AmCharts.AxisBase,construct:function(t){this.cname="CategoryAxis";AmCharts.CategoryAxis.base.construct.call(this,t);this.minPeriod="DD";this.equalSpacing=this.parseDates=!1;this.position="bottom";this.startOnAxis=!1;this.firstDayOfWeek=1;this.gridPosition="middle";this.markPeriodChange=this.boldPeriodBeginning=!0;this.safeDistance=30;this.centerLabelOnFullPeriod=!0;this.periods=[{period:"ss",count:1},{period:"ss",count:5},{period:"ss",count:10},{period:"ss",count:30},{period:"mm",count:1},{period:"mm",count:5},{period:"mm",count:10},{period:"mm",count:30},{period:"hh",count:1},{period:"hh",count:3},{period:"hh",count:6},{period:"hh",count:12},{period:"DD",count:1},{period:"DD",count:2},{period:"DD",count:3},{period:"DD",count:4},{period:"DD",count:5},{period:"WW",count:1},{period:"MM",count:1},{period:"MM",count:2},{period:"MM",count:3},{period:"MM",count:6},{period:"YYYY",count:1},{period:"YYYY",count:2},{period:"YYYY",count:5},{period:"YYYY",count:10},{period:"YYYY",count:50},{period:"YYYY",count:100}];this.dateFormats=[{period:"fff",format:"JJ:NN:SS"},{period:"ss",format:"JJ:NN:SS"},{period:"mm",format:"JJ:NN"},{period:"hh",format:"JJ:NN"},{period:"DD",format:"MMM DD"},{period:"WW",format:"MMM DD"},{period:"MM",format:"MMM"},{period:"YYYY",format:"YYYY"}];this.nextPeriod={};this.nextPeriod.fff="ss";this.nextPeriod.ss="mm";this.nextPeriod.mm="hh";this.nextPeriod.hh="DD";this.nextPeriod.DD="MM";this.nextPeriod.MM="YYYY";AmCharts.applyTheme(this,t,this.cname)},draw:function(){AmCharts.CategoryAxis.base.draw.call(this);this.generateDFObject();var t=this.chart.chartData;this.data=t;if(AmCharts.ifArray(t)){var i,e=this.chart,s=this.start,a=this.labelFrequency,h=0;i=this.end-s+1;var r=this.gridCountR,o=this.showFirstLabel,n=this.showLastLabel,d,l="",m=AmCharts.extractPeriod(this.minPeriod);d=AmCharts.getPeriodDuration(m.period,m.count);var c,u,g,p,f,A;c=this.rotate;var C=this.firstDayOfWeek,D=this.boldPeriodBeginning,t=AmCharts.resetDateToMin(new Date(t[t.length-1].time+1.05*d),this.minPeriod,1,C).getTime(),x;this.endTime>t&&(this.endTime=t);A=this.minorGridEnabled;var v,t=this.gridAlpha,T;if(this.parseDates&&!this.equalSpacing){this.timeDifference=this.endTime-this.startTime;s=this.choosePeriod(0);a=s.period;c=s.count;u=AmCharts.getPeriodDuration(a,c);u<d&&(a=m.period,c=m.count,u=d);g=a;"WW"==g&&(g="DD");this.stepWidth=this.getStepWidth(this.timeDifference);var r=Math.ceil(this.timeDifference/u)+5,b=l=AmCharts.resetDateToMin(new Date(this.startTime-u),a,c,C).getTime();g==a&&1==c&&this.centerLabelOnFullPeriod&&(f=u*this.stepWidth);this.cellWidth=d*this.stepWidth;i=Math.round(l/u);s=-1;i/2==Math.round(i/2)&&(s=-2,l-=u);var M=e.firstTime,y=0;A&&1<c&&(v=this.chooseMinorFrequency(c),T=AmCharts.getPeriodDuration(a,v));if(0<this.gridCountR)for(i=s;i<=r;i++){m=M+u*(i+Math.floor((b-M)/u))-y;"DD"==a&&(m+=36e5);m=AmCharts.resetDateToMin(new Date(m),a,c,C).getTime();"MM"==a&&(A=(m-l)/u,1.5<=(m-l)/u&&(m=m-(A-1)*u+AmCharts.getPeriodDuration("DD",3),m=AmCharts.resetDateToMin(new Date(m),a,1).getTime(),y+=u));d=(m-this.startTime)*this.stepWidth;A=!1;this.nextPeriod[g]&&(A=this.checkPeriodChange(this.nextPeriod[g],1,m,l,g));x=!1;A&&this.markPeriodChange?(A=this.dateFormatsObject[this.nextPeriod[g]],this.twoLineMode&&(A=this.dateFormatsObject[g]+"\n"+A,A=AmCharts.fixBrakes(A)),x=!0):A=this.dateFormatsObject[g];D||(x=!1);l=AmCharts.formatDate(new Date(m),A,e);if(i==s&&!o||i==r&&!n)l=" ";this.labelFunction&&(l=this.labelFunction(l,new Date(m),this,a,c,p).toString());this.boldLabels&&(x=!0);p=new this.axisItemRenderer(this,d,l,!1,f,0,!1,x);this.pushAxisItem(p);p=l=m;if(!isNaN(v))for(d=1;d<c;d+=v)this.gridAlpha=this.minorGridAlpha,A=m+T*d,A=AmCharts.resetDateToMin(new Date(A),a,v,C).getTime(),A=new this.axisItemRenderer(this,(A-this.startTime)*this.stepWidth),this.pushAxisItem(A);this.gridAlpha=t}}else if(!this.parseDates){if(this.cellWidth=this.getStepWidth(i),i<r&&(r=i),h+=this.start,this.stepWidth=this.getStepWidth(i),0<r)for(D=Math.floor(i/r),v=this.chooseMinorFrequency(D),d=h,d/2==Math.round(d/2)&&d--,0>d&&(d=0),r=0,this.end-d+1>=this.autoRotateCount&&(this.labelRotation=this.autoRotateAngle),i=d;i<=this.end+2;i++){p=!1;0<=i&&i<this.data.length?(g=this.data[i],l=g.category,p=g.forceShow):l="";if(A&&!isNaN(v))if(i/v==Math.round(i/v)||p)i/D==Math.round(i/D)||p||(this.gridAlpha=this.minorGridAlpha,l=void 0);else continue;else if(i/D!=Math.round(i/D)&&!p)continue;d=this.getCoordinate(i-h);p=0;"start"==this.gridPosition&&(d-=this.cellWidth/2,p=this.cellWidth/2);C=!0;tickShift=p;"start"==this.tickPosition&&(tickShift=0,C=!1,p=0);if(i==s&&!o||i==this.end&&!n)l=void 0;Math.round(r/a)!=r/a&&(l=void 0);r++;b=this.cellWidth;c&&(b=NaN);this.labelFunction&&g&&(l=this.labelFunction(l,g,this));l=AmCharts.fixBrakes(l);x=!1;this.boldLabels&&(x=!0);i>this.end&&"start"==this.tickPosition&&(l=" ");p=new this.axisItemRenderer(this,d,l,C,b,p,void 0,x,tickShift,!1,g.labelColor);p.serialDataItem=g;this.pushAxisItem(p);this.gridAlpha=t}}else if(this.parseDates&&this.equalSpacing){h=this.start;this.startTime=this.data[this.start].time;this.endTime=this.data[this.end].time;this.timeDifference=this.endTime-this.startTime;s=this.choosePeriod(0);a=s.period;c=s.count;u=AmCharts.getPeriodDuration(a,c);u<d&&(a=m.period,c=m.count,u=d);g=a;"WW"==g&&(g="DD");this.stepWidth=this.getStepWidth(i);r=Math.ceil(this.timeDifference/u)+1;l=AmCharts.resetDateToMin(new Date(this.startTime-u),a,c,C).getTime();this.cellWidth=this.getStepWidth(i);i=Math.round(l/u);s=-1;i/2==Math.round(i/2)&&(s=-2,l-=u);d=this.start;d/2==Math.round(d/2)&&d--;0>d&&(d=0);f=this.end+2;f>=this.data.length&&(f=this.data.length);T=!1;T=!o;this.previousPos=-1e3;20<this.labelRotation&&(this.safeDistance=5);u=d;if(this.data[d].time!=AmCharts.resetDateToMin(new Date(this.data[d].time),a,c,C).getTime())for(C=0,x=l,i=d;i<f;i++)m=this.data[i].time,this.checkPeriodChange(a,c,m,x)&&(C++,2<=C&&(u=i,i=f),x=m);A&&1<c&&(v=this.chooseMinorFrequency(c),AmCharts.getPeriodDuration(a,v));if(0<this.gridCountR)for(i=d;i<f;i++)if(m=this.data[i].time,this.checkPeriodChange(a,c,m,l)&&i>=u){d=this.getCoordinate(i-this.start);A=!1;this.nextPeriod[g]&&(A=this.checkPeriodChange(this.nextPeriod[g],1,m,l,g));x=!1;A&&this.markPeriodChange?(A=this.dateFormatsObject[this.nextPeriod[g]],x=!0):A=this.dateFormatsObject[g];l=AmCharts.formatDate(new Date(m),A,e);if(i==s&&!o||i==r&&!n)l=" ";T?T=!1:(D||(x=!1),d-this.previousPos>this.safeDistance*Math.cos(this.labelRotation*Math.PI/180)&&(this.labelFunction&&(l=this.labelFunction(l,new Date(m),this,a,c,p)),this.boldLabels&&(x=!0),p=new this.axisItemRenderer(this,d,l,void 0,void 0,void 0,void 0,x),C=p.graphics(),this.pushAxisItem(p),p=C.getBBox().width,AmCharts.isModern||(p-=d),this.previousPos=d+p));p=l=m}else isNaN(v)||(this.checkPeriodChange(a,v,m,b)&&(this.gridAlpha=this.minorGridAlpha,d=this.getCoordinate(i-this.start),A=new this.axisItemRenderer(this,d),this.pushAxisItem(A),b=m),this.gridAlpha=t)}for(i=0;i<this.data.length;i++)if(o=this.data[i])n=this.parseDates&&!this.equalSpacing?Math.round((o.time-this.startTime)*this.stepWidth+this.cellWidth/2):this.getCoordinate(i-h),o.x[this.id]=n;o=this.guides.length;for(i=0;i<o;i++)n=this.guides[i],D=D=D=t=s=NaN,v=n.above,n.toCategory&&(D=e.getCategoryIndexByValue(n.toCategory),isNaN(D)||(s=this.getCoordinate(D-h),n.expand&&(s+=this.cellWidth/2),p=new this.axisItemRenderer(this,s,"",!0,NaN,NaN,n),this.pushAxisItem(p,v))),n.category&&(D=e.getCategoryIndexByValue(n.category),isNaN(D)||(t=this.getCoordinate(D-h),n.expand&&(t-=this.cellWidth/2),D=(s-t)/2,p=new this.axisItemRenderer(this,t,n.label,!0,NaN,D,n),this.pushAxisItem(p,v))),n.toDate&&(n.toDate instanceof Date||(n.toDate=AmCharts.stringToDate(n.toDate,e.dataDateFormat)),this.equalSpacing?(D=e.getClosestIndex(this.data,"time",n.toDate.getTime(),!1,0,this.data.length-1),isNaN(D)||(s=this.getCoordinate(D-h))):s=(n.toDate.getTime()-this.startTime)*this.stepWidth,p=new this.axisItemRenderer(this,s,"",!0,NaN,NaN,n),this.pushAxisItem(p,v)),n.date&&(n.date instanceof Date||(n.date=AmCharts.stringToDate(n.date,e.dataDateFormat)),this.equalSpacing?(D=e.getClosestIndex(this.data,"time",n.date.getTime(),!1,0,this.data.length-1),isNaN(D)||(t=this.getCoordinate(D-h))):t=(n.date.getTime()-this.startTime)*this.stepWidth,D=(s-t)/2,p="H"==this.orientation?new this.axisItemRenderer(this,t,n.label,!1,2*D,NaN,n):new this.axisItemRenderer(this,t,n.label,!1,NaN,D,n),this.pushAxisItem(p,v)),(0<s||0<t)&&(s<this.width||t<this.width)&&(s=new this.guideFillRenderer(this,t,s,n),t=s.graphics(),this.pushAxisItem(s,v),n.graphics=t,t.index=i,n.balloonText&&this.addEventListeners(t,n))}this.axisCreated=!0;e=this.x;h=this.y;this.set.translate(e,h);this.labelsSet.translate(e,h);this.positionTitle();(e=this.axisLine.set)&&e.toFront();e=this.getBBox().height;2<e-this.previousHeight&&this.autoWrap&&!this.parseDates&&(this.axisCreated=this.chart.marginsUpdated=!1);this.previousHeight=e},chooseMinorFrequency:function(t){for(var i=10;0<i;i--)if(t/i==Math.round(t/i))return t/i},choosePeriod:function(t){var i=AmCharts.getPeriodDuration(this.periods[t].period,this.periods[t].count),e=Math.ceil(this.timeDifference/i),s=this.periods;return this.timeDifference<i&&0<t?s[t-1]:e<=this.gridCountR?s[t]:t+1<s.length?this.choosePeriod(t+1):s[t]},getStepWidth:function(t){var i;this.startOnAxis?(i=this.axisWidth/(t-1),1==t&&(i=this.axisWidth)):i=this.axisWidth/t;return i},getCoordinate:function(t){t*=this.stepWidth;this.startOnAxis||(t+=this.stepWidth/2);return Math.round(t)},timeZoom:function(t,i){this.startTime=t;this.endTime=i},minDuration:function(){var t=AmCharts.extractPeriod(this.minPeriod);return AmCharts.getPeriodDuration(t.period,t.count)},checkPeriodChange:function(t,i,e,s,a){e=new Date(e);var h=new Date(s),r=this.firstDayOfWeek;s=i;"DD"==t&&(i=1);e=AmCharts.resetDateToMin(e,t,i,r).getTime();i=AmCharts.resetDateToMin(h,t,i,r).getTime();return"DD"==t&&"hh"!=a&&e-i<=AmCharts.getPeriodDuration(t,s)?!1:e!=i?!0:!1},generateDFObject:function(){this.dateFormatsObject={};var t;for(t=0;t<this.dateFormats.length;t++){var i=this.dateFormats[t];this.dateFormatsObject[i.period]=i.format}},xToIndex:function(t){var i=this.data,e=this.chart,s=e.rotate,a=this.stepWidth;this.parseDates&&!this.equalSpacing?(t=this.startTime+Math.round(t/a)-this.minDuration()/2,e=e.getClosestIndex(i,"time",t,!1,this.start,this.end+1)):(this.startOnAxis||(t-=a/2),e=this.start+Math.round(t/a));var e=AmCharts.fitToBounds(e,0,i.length-1),h;i[e]&&(h=i[e].x[this.id]);s?h>this.height+1&&e--:h>this.width+1&&e--;0>h&&e++;return e=AmCharts.fitToBounds(e,0,i.length-1)},dateToCoordinate:function(t){return this.parseDates&&!this.equalSpacing?(t.getTime()-this.startTime)*this.stepWidth:this.parseDates&&this.equalSpacing?(t=this.chart.getClosestIndex(this.data,"time",t.getTime(),!1,0,this.data.length-1),this.getCoordinate(t-this.start)):NaN},categoryToCoordinate:function(t){return this.chart?(t=this.chart.getCategoryIndexByValue(t),this.getCoordinate(t-this.start)):NaN},coordinateToDate:function(t){return this.equalSpacing?(t=this.xToIndex(t),new Date(this.data[t].time)):new Date(this.startTime+t/this.stepWidth)}});
//# sourceMappingURL=serial.map.js